<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ include file="../../Include/Config.jsp"%>
<html>
  <head>
    <title>Web Ram Program</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="ram/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/jquery-1.7.1.js"></script>
    <script type="text/javascript">
      $(function(){

        	<logic:messagesPresent message="true">
    	      <html:messages message="true" id="msg">
    	        var msgs = '<bean:write name="msg" />'; 
  	            msgs = msgs.replace(/\?/g, '');
  	            msgs = msgs.replace(/en_US./g, '');
  	            msgs = msgs.replace(/ko_KR./g, '');
               if(msgs.search("성공") >= 0){
            	    alert(msgs);
                    location.href="member.do";
               }

               if(msgs.search("이미") >= 0){
           	        alert(msgs);
               }

               if(msgs.search("실패") >= 0){
              	    alert(msgs);
               }
    	      </html:messages>
          </logic:messagesPresent>

          $("#insertImg").css("cursor","pointer").click(function(){
              $("#method").val("insert");
              var memName = $("#memName").val();
              if(memName == "" || memName == undefined){
                  alert("회원명을 입력해주세요.");
                  $("#memName").focus();
                  return false;
              }
              var memPw = $("#memPw").val();
              if(memPw == "" || memPw == undefined){
                  alert("비밀번호를 입력해주세요.");
                  $("#memPw").focus();
                  return false;
              }
              var memEmail = $("#memEmail").val();
              if(memEmail == "" || memEmail == undefined){
                  alert("E-mail을 입력해주세요.");
                  $("#memEmail").focus();
                  return false;
              }
              var memTel = $("#memTel").val();
              if(memTel == "" || memTel == undefined){
                  alert("전화번호를 입력해주세요.");
                  $("#memTel").focus();
                  return false;
              }
              var memAddress = $("#memAddress").val();
              if(memAddress == "" || memAddress == undefined){
                  alert("주소를 입력해주세요.");
                  $("#memAddress").focus();
                  return false;
              }

              if(confirm("저장하시겠습니까?")){
                  var form = $("form")[0];
                  form.submit();
              }
          });

          $("#listImg").css("cursor","pointer").click(function(){
              location.href = "member.do";
          });
          
      });
    </script>
  </head>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <html:form method="post" action="member-submit.do" >
    <input type="hidden" name="method" id="method"/>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="60">
                <!----- header ----------->
                <%@ include file="../../Include/Header.jsp"%>
                <!----- header end ----------->
              </td>
            </tr>
            <tr>
              <td>
                <div align="left">
                  <table width="1251" border="0" cellpadding="0" cellspacing="0">
                    <tr valign="top">
                      <td width="180" height="473">
                        <%@ include file="../../Include/Admin_Left.jsp"%>
                      </td>
                      <td width="20">&nbsp;</td>
                      <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td>
                              <!----<table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="30" align="center" bgcolor="#333333">
                                    <font color="#FFFFFF">
                                      <strong>
                                             회원 상세보기
                                      </strong>
                                    </font>
                                  </td>
                                </tr>
                                <tr>
                                  <td height="1" bgcolor="f44901"></td>
                                </tr>
                                <tr>
                                  <td bgcolor="#f4f4f4">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="10">
                                      <tr>
                                        <td valign="top">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td height="22">
                                                <p align="right">Home&gt;Admin&gt;회원관리</p>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                    </table>
                                  </td>
                                </tr>
                              </table>--->
							  <img src="ram/images/member-reg.jpg">
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>
                              <table width="1048" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <!------------------------------------------ 프로그램 적용 시작 -------------------------------->
                                  <td width="1048">
                                    <table width="1050" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td height="30" width="1050"><font color="ff3300"><b>기본정보</b></font></td>
                                      </tr>
                                      <tr>
                                        <td width="1050">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td bgcolor="#DDDDDD">
                                                <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">아이디</td>
                                                    <td height="30" bgcolor="#FFFFFF" width="593">
                                                      <p>
                                                        <html:text styleClass="grayform" size="36" property="memId" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">회원명</td>
                                                    <td width="593" height="30" bgcolor="#FFFFFF">
                                                      <p>
                                                        <html:text  property="memName" styleId="memName" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">비밀번호</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:password  property="memPw" styleId="memPw" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">회사명</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:text  property="memCompany" styleId="memCompany" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>                                                  
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">이메일</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:text  property="memEmail" styleId="memEmail" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">연락처</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:text  property="memTel" styleId="memTel" styleClass="grayform" size="36"/>
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">주소</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:text  property="memAddress" styleId="memAddress" styleClass="grayform" size="36"/>
                                                      </p>
                                                    </td>
                                                  </tr><%--
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">승인유무</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <html:select  property="memOk" size="1">
                                                        <html:option value="Y">Y</html:option>
                                                        <html:option value="N">N</html:option>
                                                      </html:select>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">등급</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <html:select  property="memLevel" size="1">
                                                        <html:option value="0">일반</html:option>
                                                        <html:option value="1">관리자</html:option>
                                                      </html:select>
                                                    </td>
                                                  </tr>
                                                --%></table>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                      <tr>
                                      <td height="50" align="center" width="1050">
                                        <img id="insertImg" src="ram/images/btn_input.jpg" border="0">
                                        <img id="listImg" src="ram/images/btn_list.jpg" border="0">
                                      </td>
                                    </tr>
                                    <tr>
                                      <td width="1050">&nbsp;</td>
                                    </tr>
                                  </table>
                                </td>
                                <!------------------------------------------ 프로그램 적용 끝 -------------------------------->
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                      </table>
                      <p>&nbsp;</p>
                    </td>
                  </tr>
                </table>
              </div>
            </td>
          </tr>
          <tr>
            <td align="center">
              <%@ include file="../../Include/Foot.jsp"%>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  </html:form>
</body>
</html>